<template>
  <div class="container">
    <h4 style="margin-bottom: 10px">确定要删除此条nacos配置吗？</h4>
    <div style="margin-bottom: 10px" class="box">
      <span class="title">dataId:</span>
      <span class="value">{{ row.dataId }}</span>
    </div>
    <div class="box">
      <span class="title">Group:</span>
      <span class="value">{{ row.group }}</span>
    </div>
  </div>
</template>

<script>
import { nacosConfigApi } from "@/api/nacosList";
export default {
  name: "rollback",
  components: {},
  props: {
    row: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {};
  },
  created() {
    this.$parent.setMinHeight(0);
    this.$emit("SetTitle", "删除nacos配置");
    this.$emit("SetPageActions", [
      {
        text: "确定",
        theme: "primary",
        handle: () => {
          nacosConfigApi.deleteConfig(this.row).then(() => {
            this.$message.success("删除成功");
            this.$emit("Close", true);
          })
        }
      },
      {
        text: "取消",
        handle: () => {
          this.$emit("Close");
        }
      }
    ]);
  },
  mounted() {},
  methods: {},
  computed: {},
  watch: {}
};
</script>

<style lang='less' scoped >
.box {
  display: flex;
  align-items: center;
}
.title {
  color: rgb(153, 153, 153);
  margin-right: 5px;
}
.value {
  color: rgb(199, 37, 78);
}
</style>
